<?php echo script::add('jquery'), script::add('checkbox'); ?>
<script type="text/javascript">$(document).ready(function(){$('#checkbox_all_button').checkbox_all('.list_id');$('#checkbox_none_button').checkbox_none('.list_id');$('#checkbox_anti_button').checkbox_anti('.list_id');$('#checkbox_all_checkbox').checkbox_checkbox('.list_id');
$('#delete_list_button').click(function(){var list_id=$.checkbox_get_id('.list_id');if(list_id==''){alert('请选择所要删除的评论!');return false;}if(!confirm('你确认要进行删除操作?')){return false;}$.post('<?php echo $this->get_action_url('ajax_delete_comment'); ?>', {mode:1,list_id:list_id}, function(data){if(data==101){alert('恭喜!删除成功!');location.reload();}else{alert(data);}});});
$('#validate_list_button').click(function(){var list_id=$.checkbox_get_id('.list_id');if(list_id==''){alert('请选择所要审核的评论!');return false;}$.post('<?php echo $this->get_action_url('ajax_verlidata_comment'); ?>', {mode:0,list_id:list_id}, function(data){if(data==101){alert('恭喜,操作成功!');location.reload();}else{alert(data);}});});
});function delete_single_list(id){if(!confirm('你确认要进行删除操作?')){return false;}$.post('<?php echo $this->get_action_url('ajax_delete_comment'); ?>', {mode:0,list_id:id}, function(data){if(data==101){alert('恭喜!删除成功!');location.reload();}else{alert(data);}});}
function edit_single_list(id){$.post('<?php echo $this->get_action_url('ajax_verlidata_comment'); ?>', {mode:0,list_id:id}, function(data){if(data==101){alert('恭喜,操作成功!');location.reload();}else{alert(data);}});}
</script>
<?php echo $pagelist_css; ?>
<table width="800" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="30" align="left">>>评论管理</td>
      </tr>
      <tr>
        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="30" align="left"><?php if($list_data == true){ ?><input type="button" name="checkbox_all_button" id="checkbox_all_button" value="全选" />&nbsp;<input type="button" name="checkbox_none_button" id="checkbox_none_button" value="全不选" />&nbsp;<input type="button" name="checkbox_anti_button" id="checkbox_anti_button" value="反选" /><?php if($is_verify == 1) { ?>&nbsp;<input type="button" name="validate_list_button" id="validate_list_button" value="审核" /><?php } ?>&nbsp;<input type="button" name="delete_list_button" id="delete_list_button" value="删除" /><?php } ?></td>
          </tr>
          <tr>
            <td align="left"><table width="100%" border="0" cellspacing="5" cellpadding="0">
              <tr>
                <td width="30" height="30" align="center" bgcolor="#CCCCCC"><input type="checkbox" name="checkbox_all_checkbox" id="checkbox_all_checkbox" /></td>
                <td width="120" align="center" bgcolor="#CCCCCC">留言者</td>
                <td width="385" align="center" bgcolor="#CCCCCC">留言内容</td>
                <td width="130" align="center" bgcolor="#CCCCCC">留言时间</td>
                <td colspan="2" align="center" bgcolor="#CCCCCC">操作</td>
              </tr>
			  <?php if($list_data == true) { foreach($list_data as $lines) {?>
              <tr style="font-size:12px;">
                <td height="60" align="center" valign="top"><input type="checkbox" name="list_name" value="<?php echo $lines['comment_id']; ?>" class="list_id" /></td>
                <td align="center" valign="top"><?php echo $lines['comment_author']; ?><br /><?php if($lines['author_email']) { ?><a href="mailto:<?php echo $lines['author_email']; ?>">Email</a><?php } ?>&nbsp;&nbsp;<?php if($lines['author_site']) { ?><a href="<?php echo $lines['author_site']; ?>">Site</a><?php } ?></td>
                <td align="left" valign="top"><?php echo $lines['comment_content']; ?></td>
                <td align="center" valign="top"><?php echo $lines['comment_date']; ?><br />IP：<?php echo $lines['comment_ip']; ?></td>
                <td width="50" align="center" valign="top"><?php if(($is_verify == 1) &&($lines['approved'] == 0)) {?><a href="javascript:void(0);" onclick="edit_single_list(<?php echo $lines['comment_id']; ?>)">审核</a><?php } ?></td>
                <td width="50" align="center" valign="top"><a href="javascript:void(0);" onclick="delete_single_list(<?php echo $lines['comment_id']; ?>)">删除</a></td>
              </tr>
			  <?php } } else { ?>
              <tr>
                <td height="30" colspan="6" align="center">暂无数据</td>
              </tr>
			  <?php } ?>
            </table></td>
          </tr>
          <tr>
            <td height="30" align="left">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
</table>